<?php
namespace API\Controller;
use Think\Controller;
class GameController extends Controller {
	//查看所有比赛信息接口
    public function getGames(){


        $games = M('games');
        $data = $games -> order("g_id")->select();

        echo json_encode($data);
         echo "<br>";

    }
    //查看比赛详情接口
    public function getGameById(){
        $g_id = $_GET['g_id'];
   
        $getGameById = M('games');
        $data = $getGameById -> where("g_id='$g_id'")-> select();

        echo json_encode($data);
         echo "<br>";
     }
}
?>
